import request from '../Utils/request';

//通过id获取用户
export function getbyId(id) {
    return request.get(`/users/${id}`)
}

//获取用户列表
export function getList(params) {
    return request.get('/users', { params: params })
}

//通过id删除指定用户
export function deleteUsers(id) {
    return request.delete(`/users/${id}`);
}

//新增用户
export function addUser(data) {
    return request.post('/users', data)
}

//修改用户
export function modUser(id, data) {
    return request.put(`/users/${id}`, data)
}

// 用户登录，获取token
export function login(data) {
    return request.post(`/users/token`,data)
}

//查询数据
export function query(data) {
    return request.post(`/users/query`,data)
}

